import com.itheima.config.SpringConfig;
import com.itheima.domain.Account;
import com.itheima.service.AccountService;
import com.itheima.service.impl.AccountServiceImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class APP {
    public static void main(String[] args) {
//        ApplicationContext applicationContext=new AnnotationConfigApplicationContext(SpringConfig.class);
//        applicationContext.getBean("dateSource");

        ApplicationContext cxt=new AnnotationConfigApplicationContext(SpringConfig.class);
        AccountService accountService = (AccountService) cxt.getBean("accountService");
        Account byId = accountService.findById(1);
        System.out.println(byId);
    }
}
